/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lab4;

import templates.State;
import java.util.ArrayList;
import states.InitialState;

/**
 *
 * @author morar.ciprian
 */
public class WaterCupState {
    public int capacity1;
    public int capacity2;

   

    public int getCapacity1() {
        return capacity1;
    }

    public void setCapacity1(int capacity1) {
        this.capacity1 = capacity1;
    }

    public int getCapacity2() {
        return capacity2;
    }

    public void setCapacity2(int capacity2) {
        this.capacity2 = capacity2;
    }


    public WaterCupState(int capacity1, int capacity2) {
        this.capacity1 = capacity1;
        this.capacity2 = capacity2;
    }
    public WaterCupState() {
        this.capacity1 = 0;
        this.capacity2 = 0;
    }

    
    public boolean equals(WaterCupState w) {
        if(w.getCapacity1()==this.getCapacity1()&& w.getCapacity2()==this.getCapacity2())
        return true;
        else return false;
        

    }
public static State<WaterCupState> initalState ( ) {
 return new State<WaterCupState>(new WaterCupState ( ) ,new
InitialState() ) ;
 }
    @Override
    public int hashCode() {
        int hash = 7;
        hash = 3 * hash + this.capacity1;
        hash = 4 * hash + this.capacity2;
        return hash;
    }



    @Override
    public String toString() {
        return "WaterCupState{" + "capacity1=" + capacity1 + "capacity2=" + capacity2 + "}";
    }

    public static ArrayList<State<WaterCupState>> finalStates()
    {
    ArrayList<State<WaterCupState>>fStates = new ArrayList<State<WaterCupState>>();
    fStates.add(new State<WaterCupState>(new WaterCupState(0,2),null));
    fStates.add(new State<WaterCupState>(new WaterCupState(1,2),null));
    fStates.add(new State<WaterCupState>(new WaterCupState(2,2),null));
    fStates.add(new State<WaterCupState>(new WaterCupState(3,2),null));
    return fStates;
    }



}
